# -*- coding: utf-8 -*-
"""
@Author: Logan
@Date:   2025/7/1 11:31
@Description: 
"""
from selenium.webdriver.common.by import By

from base.LeftMenuBase import LeftMenuBase
from base.ObjectMap import ObjectMap


class ExternalLinkPage(LeftMenuBase, ObjectMap):

    def goto_imooc(self, driver, one_menu_name):
        """
        切换窗口句柄为慕课网
        :param driver:
        :param one_menu_name:
        :return:
        """
        link_xpath = self.level_one_menu(one_menu_name)
        self.element_click(driver,By.XPATH, link_xpath)
        self.switch_window_2_latest_handle(driver)
        return driver.title
